import torch
import numpy as np

x = torch.empty((2,2), dtype=torch.float16).uniform_(-1000,1000)
print(x)
mish = torch.nn.Mish()
y = mish(x)
print(y)
def softplus(x:np.ndarray):
    return np.log(1 + np.exp(x))
    
def tanh_fn(x):
    a = np.exp(x)
    b = 1/a
    return (a - b)/(a + b)
    
def mish_fn(x):
    return x * tanh_fn(softplus(x))

yy = mish_fn(x)
print(yy)


x = torch.tensor(21, dtype=torch.float)

y = torch.nn.Softplus()(x)
print(y)